SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 48130: Incorrect results might be generated when you summarize a column in a database management system table

DetailsAboutRate It

Running an SQL procedure (PROC) query against an Oracle database management system (DBMS) table might result in incorrect results if the query includes an inline view and a summary function both inside and outside of the inline view. The query that is passed to Oracle might not include the GROUP BY clause that was outside the inline view. Also, the summary function that was in the inline view might be recalculated outside the inline view, replacing the calculation from within the inline view.


The problem occurs if you submit a query similar to the following:
proc sql; select cnts, count(*) from ( select age, sex, count(*) as cnts from oralib.class group by age, sex) group by cnts; quit;
What gets submitted to Oracle might be similar to the following:
select COUNT(*) as cnts, COUNT(*) from ( select class."AGE", class."SEX",
COUNT(*) as cnts from CLASS group by CLASS."AGE", CLASS."SEX" )
The only workaround is to break up the query into two queries, such that the first query is the code within the inline view and the second includes the rest of the query, using the output from the first query as input.

Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemSAS/ACCESS Interface to Oraclez/OS9.2 TS1M09.2 TS2M3
Microsoft® Windows® for 64-Bit Itanium-based Systems9.2 TS1M09.2 TS2M3
Microsoft Windows Server 2003 Datacenter 64-bit Edition9.2 TS1M09.2 TS2M3
Microsoft Windows Server 2003 Enterprise 64-bit Edition9.2 TS1M09.2 TS2M3
Microsoft Windows XP 64-bit Edition9.2 TS1M09.2 TS2M3
Microsoft® Windows® for x649.2 TS1M09.2 TS2M3
Microsoft Windows Server 2003 Datacenter Edition9.2 TS1M09.2 TS2M3
Microsoft Windows Server 2003 Enterprise Edition9.2 TS1M09.2 TS2M3
Microsoft Windows Server 2003 Standard Edition9.2 TS1M09.2 TS2M3
Microsoft Windows XP Professional9.2 TS1M09.2 TS2M3
Windows Vista9.2 TS1M09.2 TS2M3
Windows Vista for x649.2 TS1M09.2 TS2M3
64-bit Enabled AIX9.2 TS1M09.2 TS2M3
64-bit Enabled HP-UX9.2 TS1M09.2 TS2M3
64-bit Enabled Solaris9.2 TS1M09.2 TS2M3
HP-UX IPF9.2 TS1M09.2 TS2M3
Linux9.2 TS1M09.2 TS2M3
Linux for x649.2 TS1M09.2 TS2M3
OpenVMS on HP Integrity9.2 TS1M09.2 TS2M3
Solaris for x649.2 TS1M09.2 TS2M3
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.